﻿using System;
using System.Data;
using System.Web.UI.WebControls;
using Resources;

public partial class sparepartWarrantyAlert : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!new Utility().TestPermissions(Resource.PermissionWarrantyAlert))
        {
            lblMessageValidate.Text = Resource.Permission;
            grdTemporary.Visible = false;
            grdEquipment.Visible = false;
            lblTotalEquipment.Visible = false;
            txtPurchaseDate.Visible = false;
            imgCalendar.Visible = false;
            btnSearch.Visible = false;
            lbldate.Visible = false;
            return;
        }
    }
    protected void odsEquipAlert_Selected(object sender, ObjectDataSourceStatusEventArgs e)
    {
        lblTotalEquipment.Text = "Total spare-parts  : " + (e.ReturnValue != null ? ((DataTable)e.ReturnValue).Rows.Count.ToString() : 0.ToString());
        grdTemporary.Visible = ((DataTable)e.ReturnValue) == null ? true : ((DataTable)e.ReturnValue).Rows.Count == 0 ? true : false;
    }
    protected void btnSearch_Click(object sender, EventArgs e)
    {

    }
    protected void grdEquipment_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        new Utility().SetSelectedColorToGridView(e, grdEquipment);
    }
    protected void grdTemporary_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
}
